package cn.cat.main.callable;

import java.util.concurrent.Callable;

public class Task implements Callable<Object> {

    private Integer taskid;

    private String status = "success";

    public Task(Integer taskid) {
        this.taskid = taskid;
    }

    public Object call() throws Exception {
        System.out.println("任务[" + taskid + "]开始执行");
        if (taskid % 2 == 0) {
            return status;
        } else {
            status = "fail";
        }
        return status;
    }
}
